home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earkit / socket / miami3 / miamisdk / netinclude / net / pcap.h < prev    next >
C/C++ Source or Header  |  1998-05-24  |  1KB  |  53 lines

  1. #ifndef _NET_PCAP_H
  2. #define _NET_PCAP_H
  3.  
  4. #ifndef _SYS_TYPES_H_
  5. #include <sys/types.h>
  6. #endif
  7.  
  8. #ifndef _SYS_TIME_H_
  9. #include <sys/time.h>
  10. #endif
  11.  
  12. #ifndef _NET_BPF_H_
  13. #include <net/bpf.h>
  14. #endif
  15.  
  16. #define PCAP_VERSION_MAJOR 2
  17. #define PCAP_VERSION_MINOR 4
  18.  
  19. #define PCAP_ERRBUF_SIZE 256
  20.  
  21. typedef    long bpf_int32;
  22. typedef    u_long bpf_u_int32;
  23.  
  24. typedef struct pcap pcap_t;
  25. typedef struct pcap_dumper pcap_dumper_t;
  26.  
  27. struct pcap_file_header {
  28.     bpf_u_int32 magic;
  29.     u_short version_major;
  30.     u_short version_minor;
  31.     bpf_int32 thiszone;    /* gmt to local correction */
  32.     bpf_u_int32 sigfigs;    /* accuracy of timestamps */
  33.     bpf_u_int32 snaplen;    /* max length saved portion of each pkt */
  34.     bpf_u_int32 linktype;    /* data link type (DLT_*) */
  35. };
  36.  
  37. struct pcap_pkthdr {
  38.     struct timeval ts;    /* time stamp */
  39.     bpf_u_int32 caplen;    /* length of portion present */
  40.     bpf_u_int32 len;    /* length this packet (off wire) */
  41. };
  42.  
  43. struct pcap_stat {
  44.     u_int ps_recv;        /* number of packets received */
  45.     u_int ps_drop;        /* number of packets dropped */
  46.     u_int ps_ifdrop;    /* drops by interface XXX not yet supported */
  47. };
  48.  
  49. typedef void (*pcap_handler)(u_char *, const struct pcap_pkthdr *,
  50.                  const u_char *);
  51.  
  52. #endif
  53.